<?php 
/**
 * 阳关灿烂视频播放
 * @author Haiqin
 *
 */
namespace Home\Controller;
class VideoController extends CommonController{
	public function index(){
		$this->display();
	}
	
	public function getvideo(){
		$page = I('page',1);
		$info = D('MaterialVideos')->where($map)->order('id desc')->page($page,10)->select();
		count($info) < 10 ? $next = 'no':$next = 'yes';
		$data = array(
				'next'=>$next,
				'info'=>$info,
		);
		$this->ajaxReturn($data);
	}

	public function article(){
		$id = I('id');
		$this->info = D('MaterialVideos')->where(array('id'=>$id))->find();
		//判断用户是否点赞
		$uid = $_SESSION['_loginUser_home']['uid'];
		$bool = D('YgclDianzai','Service')->get_isdianzai($uid,$id,'video');
		$bool ? $t = 1:$t=0;
		$this->isdianzai = $t;
		$this->display();
	}
	
	public function detail(){
		$id = I('id');
		$xiaoqu = M('YgclDistrict')->where(array('id'=>$id))->find();
		
		//支付参数
		$openid = $_SESSION['_loginUser_home']['openid'];
		$ddbh = '11111111';
		$body = 'aaaaaaaa';
		$total_fee = '1';
		$notify_url = 'http://ygcl.kongkonghou.cn/weixin/pay/notify.html';
		$jsApiParameters = A('Weixin/Pay')->getConfig($openid,$ddbh,$body,$total_fee,$notify_url);
// 		dump($jsApiParameters);
// 		exit();
		$this->jsApiParameters = $jsApiParameters;

		//判断用户是否点赞
		$uid = $_SESSION['_loginUser_home']['uid'];
		$bool = D('YgclDianzai','Service')->get_isdianzai($uid,$id,'xiaoqu');
		$bool ? $t = 1:$t=0;
		$this->isdianzai = $t;
		$this->xiaoqu = $xiaoqu;
		$this->display();
	}
}
?>